from Model import Actor
from Visualization import Visualizations
from segmentation.Formatter import Formatter
import sys
    
if __name__ == "__main__":
    """create actor and evidence objects associated with the tracks we've built"""
    act1 = Actor()
    act1.name = "person1"
    act1.bound = True
    act1.atype = Actor.PERSON

    # act2 = Actor()
    # act2.name = "person2"
    # act2.bound = True
    # act2.atype = Actor.PERSON

    """read in an old track and generate MovingFast segments from it (both actors use the same location vector but with different times"""
    myFormatter = Formatter()
    tfile = open("tfile.txt","r")
    lines = tfile.readlines()
    evList = myFormatter.processTrack(lines,act1)
    track = []
    for ev in evList:
        stime = ev.starttime
        for i,loc in enumerate(ev.locations):
            print "stime: ",stime," i: ",i," loc: ",loc
            entry = [stime+i,loc]
            track.append(entry)
    # print track
    # sys.exit()
    tracks = [track]
    actors = [act1]
    Visualizations.animatetracks(tracks,actors)
